package com.tuling.netty.command;

import com.tuling.netty.session.Session;
import io.netty.channel.Channel;
import io.netty.channel.ChannelHandlerContext;

public class LoginCmdHandler implements CmdHandler<LoginCmd> {
    @Override
    public boolean supports(Cmd cmd) {
        return cmd instanceof LoginCmd;
    }


    @Override
    public void handle(ChannelHandlerContext ctx, LoginCmd cmd) {
        Channel channel = ctx.channel();
        Session.getSession().bind(cmd.getDoctorId(), "", channel);
    }
}